// main.ts
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
// import './style.css'
import 'element-plus/dist/index.css'
import App from './App.vue'
import axios from './lib/request'
import { createPinia } from 'pinia'
import directives from '@/directive'
import i18n from '@/i18n/index'
import router from "@/router/index";
import zhCN from 'element-plus/es/locale/lang/zh-cn'
import zhTW from '@/i18n/element-plus/zh-TW'
import '@/assets/iconfont/iconfont.css'

import fjyui from "fjyui";
import "../node_modules/fjyui/dist/style.css";

createApp(App).mount('#app')
const app = createApp(App)

app.use(ElementPlus, {
  locale: localStorage.getItem('i18n') == 'zh-CN' ? zhCN : zhTW
})

// 绑定axios
app.config.globalProperties.$axios = axios;
// 绑定指令
app.directive('permission', directives)
app.use(fjyui)
app.use(router)
app.use(i18n);
app.use(ElementPlus)
app.use(createPinia())
app.mount('#app')
